<?php
namespace app\teacher\controller;
use app\common\Base;
use think\Db;

class TeacherInfo extends Base {
	
	public function index() {
		$where["ID"] = appUser()["ID"];
		$result = Db::table("教师信息")->where($where)->find();
		$this->assign("detail", findResult($result));
		return $this->fetch();
	}

	public function myInfo() {
		$where["ID"] = appUser()["ID"];
		$result = Db::table("教师信息")->where($where)->find();
		return findResult($result);
	}

	public function update() {
		$all = request()->param();
		try {
			$all["ID"] = appUser()["ID"];
			update('教师信息', $all);
			return "000";
		} catch (Exception $e) {
			echo $e->getMessage();
		}
		return "999";
	}

}
